﻿package  {
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.geom.Point;
	import flash.display.Sprite;
	import flash.display.BlendMode;
	
	public class Level extends MovieClip{
		public var LevelTimer:Number = 0;
		public var NeededIngredients:Array;
		public var YourIngredients:Array;
		
		public var Ordered:Boolean;
		public var Score:Number;
		public var Score_Array:Array;
		
		public var CatSpeech:String;
		public var SoupName:String;
		
		public var LevelNumber:int;
		
		public var filter:MovieClip;
		
		public function Level() {
			YourIngredients = [];
			Score = 0;
		}
		
		protected function showResults():void{
			var results:Results = new Results(NeededIngredients, YourIngredients, Ordered, Score_Array, SoupName);
			this.parent.addChild(results);
			Util.safeRemove(this);
		}
		
		protected function createInvertedMask(mcToBeMasked:MovieClip, point:Point):void {
			mcToBeMasked.blendMode = BlendMode.LAYER;
			var invertedMask:Sprite = new Sprite();
			invertedMask.name = "theMask";
			invertedMask.graphics.lineStyle(1,0x000000);
			invertedMask.graphics.beginFill(0x0000FF);
			invertedMask.graphics.drawCircle(0,0,Constants.CANDLE_RADIUS[Settings.Difficulty]);
			invertedMask.graphics.endFill();
			invertedMask.x = point.x;
			invertedMask.y = point.y;
			invertedMask.blendMode = BlendMode.ERASE;
			mcToBeMasked.addChild(invertedMask);
			invertedMask.mouseEnabled = false;
			invertedMask.mouseChildren = false;
		}

	}
	
}
